package controllers

import (
	beego "github.com/beego/beego/v2/server/web"
	"xcvb/models"
)

type XcController struct {
	beego.Controller
}

func (c *XcController) List() {
	var xc []models.Xc
	id, _ := c.GetInt("id")
	models.DB.Where("id =?", id).Find(&xc)
	c.Data["json"] = map[string]interface{}{
		"code": 200,
		"msg":  "查询成功",
		"data": xc,
	}
	c.ServeJSON()
}
